package ynu.lcy.elememicroserviceuserauthservice9091.chain;


import ynu.lcy.elememicroservicecommon.exception.BusinessException;

public abstract class AbstractAuthenticationHandler implements AuthenticationHandler {
    protected AuthenticationHandler nextHandler;

    @Override
    public void setNextHandler(AuthenticationHandler nextHandler) {
        this.nextHandler = nextHandler;
    }

    protected void handleNext(AuthenticationContext context) throws BusinessException {
        if (nextHandler != null) {
            nextHandler.handle(context);
        }
    }
}
